home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-25 | 3.9 KB | 121 lines | [TEXT/CWIE] |
- // ==================================================
- // CTouchMeApp.h
- // Copyright (C) 1996-1997 Mizutori Tetsuya
- // July 4, 1996; February 3, 1997; April 23, 1997.
- // ==================================================
- // All documents are pretty-printed in 10-point Geneva font.
-
- #pragma once
-
- #include <LDocApplication.h>
-
- #include "CTouchMeAppleEvents.h"
- #include "CTouchMePref.h"
-
- class LWindow;
- class LArray;
- class CTouchMePref;
- class CAppleGuideFile;
-
-
- class CTouchMeApp : public LDocApplication {
-
- public:
- CTouchMeApp();
- virtual ~CTouchMeApp();
-
- // Save settings data to preferences file if 'OK' button is selected
- virtual Boolean ObeyCommand( CommandT inCommand, void * ioParam );
- virtual void FindCommandStatus( CommandT inCommand,
- Boolean & outEnabled, Boolean & outUsesMark,
- Char16 & outMark, Str255 outName );
-
- protected:
-
- // Execute once when launched by receiving Finder's OpenApplication event
- virtual void StartUp();
- // Execute every time whenever OpenDocument AppleEvent was received
- // Do touch command, or fill date time stamp field if option-key is pressed
- virtual void OpenDocument( FSSpec * inMacFSSpec );
- virtual void ChooseDocument();
- // Reset the working status every time when a series of execution has finished
- virtual void UseIdleTime( const EventRecord & inMacEvent );
- // Override the procedure to make a patch for displaying "About..." dialog
- virtual void ShowAboutBox();
-
- // Application-spicific functions
- LWindow * MakeMainWindow( void );
- void HandleDocuments( void );
-
-
- // My AppleEvent handlers for 'HandleXXX()' functions
- virtual void HandleAppleEvent(
- const AppleEvent & inAppleEvent,
- AppleEvent & outAEReply,
- AEDesc & outResult,
- Int32 inAENumber );
-
- // For responding AppleScript commands;
- // 'get prefs', 'set prefs', 'load prefs', 'save prefs', 'touch', 'fetch'
- void HandleGetPrefs( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
- void HandleSetPrefs( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
- void HandleLoadPrefs( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
- void HandleSavePrefs( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
- void HandleTouch( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
- void HandleFetch( const AppleEvent &inAppleEvent,
- AppleEvent & outAEReply, AEDesc & outResult );
-
-
- void HandleGetPrefsSettings(
- AERecord & ioAERecord,
- ETouchType inTouchType,
- Boolean toCreateNewAERecord = true );
-
- void HandleSetPrefsSettings(
- AERecord & inAERecord,
- ETouchType inTouchType );
-
- void HandleFetchDateTime(
- AERecord & ioAERecord,
- FSSpec & inMacFSSpec,
- Boolean toCreateNewAERecord = true );
-
- // A patched call-back function for displaying colored alert dialog
- static pascal Boolean MyAlertPatch( DialogRef dialog, EventRecord * event, short * item );
-
- private:
-
- LWindow * mMainWindow; // Instance object of class 'CTouchMeMainWindow'
-
- LArray * mFileArray; // Instance object of file stack array
-
- CTouchMePref * mPref; // Instance object of class 'CTouchMePref'
-
- CAppleGuideFile * mAppleGuideFile; // Instance object of Apple Guide file
-
- static ModalFilterUPP sAlertPatchProc; // A patch for displaying colored alert dialog
-
- Boolean mOpenApplication; // true if launched by the OpenApplication event
- Boolean mOpenDocument; // true if invoked by the OpenDocument event
-
- Boolean mKeyModifier; // Check the modifier key if pressed on "Open..." command
- Boolean mUpdatePref; // true if settings must be reset by prefs data
-
- long mCount; // A counter of execution times in the series of document files
-
- Boolean mIsCommandPeriod; // true if cmd-period key is pressed
- };
-
-
- // end of definitions
-